<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title></title>
</head>
<body>
<script>
    window.onload = function(){
        var xhr = new XMLHttpRequest();
        xhr.open('get','./data.json',true);
        xhr.responseType = 'json';
        xhr.onreadystatechange = function(){
            if(xhr.readyState==4 && /2\d{2}/.test(xhr.status)){
                console.log(xhr.getAllResponseHeaders());
                console.log(xhr.getResponseHeader('Content-Type'));

                var obj = xhr.response;
                console.log(obj);
            }
        }
        xhr.send();
    }
</script>
</body>
</html>